﻿<UserControl x:Class="XamlaApp.Views.ElementPropertyViews.ImagePropertyView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:prop="clr-namespace:XamlaApp.Views.ElementPropertyViews" 
    xmlns:form="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"  >
    <StackPanel>
        <prop:FrameworkElementProperties></prop:FrameworkElementProperties>
        <form:DataForm CurrentItem="{Binding}">
            <form:DataForm.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="Image Properties"></TextBlock>
                </DataTemplate>
            </form:DataForm.HeaderTemplate>
            <form:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel>
                        <form:DataField>
                            <Button x:Name="btnChangeImage" Click="btnChangeImage_Click"  HorizontalContentAlignment="Left" VerticalContentAlignment="Center">
                                <Button.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <Image  Width="40" Height="40" Source="{Binding ImageSource}" Stretch="Fill"></Image>
                                        <TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="Change Image..."></TextBlock>
                                    </StackPanel>
                                </Button.Content>                                
                            </Button>
                        </form:DataField>
                        <form:DataField Label="Stretch">
                            <ComboBox SelectedIndex="{Binding ImageStretch, Converter={StaticResource ImageStretchConverterResource}, Mode=TwoWay}">
                                <TextBlock Text="None"></TextBlock>
                                <TextBlock Text="Stretch"></TextBlock>
                                <TextBlock Text="Uniform"></TextBlock>
                                <TextBlock Text="Uniform To Fill"></TextBlock>
                            </ComboBox>
                        </form:DataField>
                    </StackPanel>
                </DataTemplate>
            </form:DataForm.EditTemplate>
        </form:DataForm>
    </StackPanel>
</UserControl>
